package com.java.yz.day01;

public class text01 {
    public static void main(String[] args) {
        String a="abcdabfecadab";
        String b="ab";
        int count =0;
        char[] arg1=a.toCharArray();
        char[] arg2=b.toCharArray();
        for (int i = 0; i < a.toCharArray().length-1; i++) {
                if (arg1[i]==arg2[0]&&arg1[i+1]==arg2[1]) {
                    count++;
                }
        }
        System.out.println("数量有："+count);
    }
}
